<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>beagleoncreate: D:/backups/Desktop/beagleoncreate/trunk/Packet.h Source File</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  <td id="projectlogo"><img alt="Logo" src="logo.png"/></td>
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">beagleoncreate
   
   </div>
   <div id="projectbrief">Beagleboard sensor interface on iRobot Create with sonar and USB webcam through WiFi</div>
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.6.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
  initNavTree('_packet_8h.html','');
</script>
<div id="doc-content">
<div class="header">
  <div class="headertitle">
<div class="title">D:/backups/Desktop/beagleoncreate/trunk/Packet.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="_packet_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="preprocessor">#ifndef PACKET_H</span>
<a name="l00002"></a>00002 <span class="preprocessor"></span><span class="preprocessor">#define PACKET_H</span>
<a name="l00003"></a>00003 <span class="preprocessor"></span>
<a name="l00004"></a>00004 <span class="preprocessor">#include &lt;sys/socket.h&gt;</span>
<a name="l00005"></a>00005 <span class="preprocessor">#include &lt;netinet/in.h&gt;</span>
<a name="l00006"></a>00006 <span class="preprocessor">#include &lt;netdb.h&gt;</span>
<a name="l00007"></a>00007 
<a name="l00011"></a><a class="code" href="_packet_8h.html#ac5b738d467a1bbf9325bcc0eaf4f5efa">00011</a> <span class="preprocessor">#define MAXPACKETSIZE 5000 </span>
<a name="l00012"></a>00012 <span class="preprocessor"></span>
<a name="l00013"></a><a class="code" href="_packet_8h.html#ac2d859718d6489331fcb6b9e9ec0b43d">00013</a> <span class="preprocessor">#define MAXARTAGSEEN 10</span>
<a name="l00014"></a>00014 <span class="preprocessor"></span>
<a name="l00015"></a><a class="code" href="_packet_8h.html#a38e61823e781890fe42b859cb17b1ea5">00015</a> <span class="preprocessor">#define SONAR_PACKET_SIZE 24</span>
<a name="l00016"></a>00016 <span class="preprocessor"></span>
<a name="l00017"></a><a class="code" href="_packet_8h.html#a73f2813a14076312ac8d579dd3f8792a">00017</a> <span class="preprocessor">#define ARTAG_PACKET_SIZE MAXARTAGSEEN*20+12</span>
<a name="l00018"></a>00018 <span class="preprocessor"></span>
<a name="l00026"></a><a class="code" href="_packet_8h.html#a0a80a7bc045affcf10846075b88cbca0">00026</a> <span class="keyword">enum</span> <a class="code" href="_packet_8h.html#a0a80a7bc045affcf10846075b88cbca0">PacketType</a>
<a name="l00027"></a>00027 {
<a name="l00029"></a><a class="code" href="_packet_8h.html#a0a80a7bc045affcf10846075b88cbca0a0cb1b2c6a7db1f1084886c98909a3f36">00029</a>         <a class="code" href="_packet_8h.html#a0a80a7bc045affcf10846075b88cbca0a0cb1b2c6a7db1f1084886c98909a3f36">INIT</a> = 1,
<a name="l00031"></a><a class="code" href="_packet_8h.html#a0a80a7bc045affcf10846075b88cbca0adc6f24fd6915a3f2786a1b7045406924">00031</a>         <a class="code" href="_packet_8h.html#a0a80a7bc045affcf10846075b88cbca0adc6f24fd6915a3f2786a1b7045406924">END</a>,
<a name="l00033"></a><a class="code" href="_packet_8h.html#a0a80a7bc045affcf10846075b88cbca0a5ea73cf9a3f5928257b1e6bc796d8490">00033</a>         <a class="code" href="_packet_8h.html#a0a80a7bc045affcf10846075b88cbca0a5ea73cf9a3f5928257b1e6bc796d8490">CTRL</a>,
<a name="l00035"></a><a class="code" href="_packet_8h.html#a0a80a7bc045affcf10846075b88cbca0a9d7d6f31868d66330397c967c4afd2d2">00035</a>         <a class="code" href="_packet_8h.html#a0a80a7bc045affcf10846075b88cbca0a9d7d6f31868d66330397c967c4afd2d2">DATA</a>,
<a name="l00037"></a><a class="code" href="_packet_8h.html#a0a80a7bc045affcf10846075b88cbca0a3501d25cdde2b141c20edb67965fb692">00037</a>         <a class="code" href="_packet_8h.html#a0a80a7bc045affcf10846075b88cbca0a3501d25cdde2b141c20edb67965fb692">IMAGE</a>,
<a name="l00039"></a><a class="code" href="_packet_8h.html#a0a80a7bc045affcf10846075b88cbca0a4cc68226cf454df7dd46f74f2a18d240">00039</a>         <a class="code" href="_packet_8h.html#a0a80a7bc045affcf10846075b88cbca0a4cc68226cf454df7dd46f74f2a18d240">SONAR</a>,
<a name="l00041"></a><a class="code" href="_packet_8h.html#a0a80a7bc045affcf10846075b88cbca0a2fd6f336d08340583bd620a7f5694c90">00041</a>         <a class="code" href="_packet_8h.html#a0a80a7bc045affcf10846075b88cbca0a2fd6f336d08340583bd620a7f5694c90">ERROR</a>,
<a name="l00043"></a><a class="code" href="_packet_8h.html#a0a80a7bc045affcf10846075b88cbca0a7690b021f467450541d8d89123429d40">00043</a>         <a class="code" href="_packet_8h.html#a0a80a7bc045affcf10846075b88cbca0a7690b021f467450541d8d89123429d40">SHUTDOWN</a>,
<a name="l00045"></a><a class="code" href="_packet_8h.html#a0a80a7bc045affcf10846075b88cbca0a6ce26a62afab55d7606ad4e92428b30c">00045</a>         <a class="code" href="_packet_8h.html#a0a80a7bc045affcf10846075b88cbca0a6ce26a62afab55d7606ad4e92428b30c">UNKNOWN</a>
<a name="l00046"></a>00046 };
<a name="l00047"></a>00047 
<a name="l00048"></a><a class="code" href="struct_packet.html">00048</a> <span class="keyword">struct </span><a class="code" href="struct_packet.html" title="This struct defines the packet structure.">Packet</a>
<a name="l00049"></a>00049 {
<a name="l00051"></a><a class="code" href="struct_packet.html#aebbae2cef32f967d0bbcabbe41dae6bf">00051</a>         <a class="code" href="_packet_8h.html#a0a80a7bc045affcf10846075b88cbca0">PacketType</a> <a class="code" href="struct_packet.html#aebbae2cef32f967d0bbcabbe41dae6bf">type</a>;
<a name="l00053"></a><a class="code" href="struct_packet.html#aa3fd938bef10e227e0518a64c0420be7">00053</a>         <span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> <a class="code" href="struct_packet.html#aa3fd938bef10e227e0518a64c0420be7">port</a>;
<a name="l00055"></a><a class="code" href="struct_packet.html#af964658ccf8996c7a36fb2bb38e889fe">00055</a>         <span class="keyword">struct </span>in_addr <a class="code" href="struct_packet.html#af964658ccf8996c7a36fb2bb38e889fe">addr</a>;
<a name="l00056"></a>00056         
<a name="l00058"></a>00058         <span class="keyword">union</span>
<a name="l00059"></a>00059         {
<a name="l00060"></a>00060                 <span class="keyword">struct</span>
<a name="l00061"></a>00061                 {
<a name="l00062"></a>00062                         <span class="keywordtype">char</span> data[256];
<a name="l00063"></a>00063                 }init;
<a name="l00064"></a>00064 
<a name="l00065"></a>00065                 <span class="keyword">struct</span>
<a name="l00066"></a>00066                 {
<a name="l00067"></a>00067                         <span class="keywordtype">char</span> data[256];
<a name="l00068"></a>00068                 }end;
<a name="l00069"></a>00069 
<a name="l00070"></a>00070                 <span class="keyword">struct</span>
<a name="l00071"></a>00071                 {
<a name="l00072"></a>00072                         <span class="keywordtype">char</span> data[256];
<a name="l00073"></a>00073                 }ctrl;
<a name="l00074"></a>00074 
<a name="l00075"></a>00075                 <span class="keyword">struct</span>
<a name="l00076"></a>00076                 {
<a name="l00077"></a>00077                         <span class="keywordtype">int</span> tagId[<a class="code" href="_packet_8h.html#ac2d859718d6489331fcb6b9e9ec0b43d">MAXARTAGSEEN</a>];
<a name="l00078"></a>00078                         <span class="keywordtype">float</span> x[<a class="code" href="_packet_8h.html#ac2d859718d6489331fcb6b9e9ec0b43d">MAXARTAGSEEN</a>];
<a name="l00079"></a>00079                         <span class="keywordtype">float</span> y[<a class="code" href="_packet_8h.html#ac2d859718d6489331fcb6b9e9ec0b43d">MAXARTAGSEEN</a>];
<a name="l00080"></a>00080                         <span class="keywordtype">float</span> z[<a class="code" href="_packet_8h.html#ac2d859718d6489331fcb6b9e9ec0b43d">MAXARTAGSEEN</a>];
<a name="l00081"></a>00081                         <span class="keywordtype">float</span> yaw[<a class="code" href="_packet_8h.html#ac2d859718d6489331fcb6b9e9ec0b43d">MAXARTAGSEEN</a>];
<a name="l00082"></a>00082                 }data;
<a name="l00083"></a>00083 
<a name="l00084"></a>00084                 <span class="keyword">struct</span>
<a name="l00085"></a>00085                 {
<a name="l00086"></a>00086                         <span class="keywordtype">int</span> width;
<a name="l00087"></a>00087                         <span class="keywordtype">int</span> height;
<a name="l00088"></a>00088                         <span class="keywordtype">char</span> data[19200];
<a name="l00089"></a>00089                 }image;
<a name="l00090"></a>00090                 
<a name="l00091"></a>00091                 <span class="keyword">struct</span>
<a name="l00092"></a>00092                 {
<a name="l00093"></a>00093                         <span class="keywordtype">float</span> dist1;
<a name="l00094"></a>00094                         <span class="keywordtype">float</span> dist2;
<a name="l00095"></a>00095                         <span class="keywordtype">float</span> dist3;
<a name="l00096"></a>00096                 }sonar;
<a name="l00097"></a>00097 
<a name="l00098"></a>00098                 <span class="keyword">struct</span>
<a name="l00099"></a>00099                 {
<a name="l00100"></a>00100                         <span class="keywordtype">int</span> errorCode;
<a name="l00101"></a>00101                         <span class="keywordtype">char</span> data[256];
<a name="l00102"></a>00102                 }<a class="code" href="main_8cpp.html#a4866b2d37ffc80c5ba705d3fcd1e0ecf" title="The error printing function.">error</a>;
<a name="l00103"></a>00103 
<a name="l00104"></a>00104                 <span class="keyword">struct</span>
<a name="l00105"></a>00105                 {
<a name="l00106"></a>00106                         <span class="keywordtype">char</span> data[256];
<a name="l00107"></a>00107                 }shutdown;
<a name="l00108"></a>00108                 <span class="keyword">struct</span>
<a name="l00109"></a>00109                 {
<a name="l00110"></a>00110                         <span class="keywordtype">char</span> data[256];
<a name="l00111"></a>00111                 }unknown;
<a name="l00112"></a>00112         }<a class="code" href="struct_packet.html#a1893176163f4dcf728ae5db195dbebdd">u</a>;
<a name="l00113"></a>00113 };
<a name="l00114"></a>00114 
<a name="l00115"></a>00115 <span class="preprocessor">#endif</span>
<a name="l00116"></a>00116 <span class="preprocessor"></span>
<a name="l00117"></a>00117 
</pre></div></div><!-- contents -->
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Defines</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="_packet_8h.html">Packet.h</a>      </li>

    <li class="footer">Generated on Sun Feb 12 2012 18:23:34 for beagleoncreate by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.6.1 </li>
   </ul>
 </div>


</body>
</html>
